package com.ctshk.sapp.visa.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.visa.req.visa.VisaProductSaveReq;
import com.ctshk.rpc.visa.req.visa.VisaSaveReq;
import com.ctshk.rpc.visa.service.IVisaProductService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.ctshk.common.web.support.BaseController;

import javax.validation.Valid;

/**
 * <p>
 * 签证产品 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-01-28
 */
@RestController
@RequestMapping("/visa-product")
public class VisaProductController extends BaseController {

    @DubboReference
    private IVisaProductService iVisaProductService;

    @ApiOperation(value="产品中心加幅设置", notes="产品中心加幅设置(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.VISA, operType = OperationLogType.ADD, operTitle = "产品中心加幅设置", operDesc = "产品中心加幅设置")
    @PostMapping("/save")
    public Result saveVisaProduct(@RequestBody @Valid VisaProductSaveReq visaProductSaveReq) {
        TokenUser user = getCurrentUser(getRequest());
        return Result.success(iVisaProductService.add(visaProductSaveReq,user));
    }

}
